<div class="container-fluid">
    <div class="wrapper">
        <div class="panel" id="nav">
            <div class="panel-heading"><h3 class="panel-title">FBA平台账号库存汇总</h3></div>
            <div class="panel-body">
                <form action="__URL__/site" method="GET">
                    <input id="order" type="hidden" value="">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-8">
                                <div class="col-sm-12 col-md-4 add-space">
                                    <div class="input-group input-group-md">
                                        <span class="input-group-addon">帐号</span>
                                        <select class="chosen-select form-control" tabindex="-1" name="accountId"
                                                data-name-group="common">
                                            <option value="" class="empty-opt">-- 请选择 --</option>
                                            <volist name="accounts" id="vo">
                                                <option value="{$vo.id}">
                                                    {$vo.name}
                                                </option>
                                            </volist>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-12 col-md-4 add-space">
                                    <div class="input-group input-group-md">
                                        <span class="input-group-addon">站点</span>
                                        <select class="chosen-select form-control" tabindex="-1" name="siteId"
                                                data-name-group="common">
                                            <option value="" class="empty-opt">-- 请选择 --</option>
                                            <volist name="sites" id="vo" key="siteId">
                                                <option value="{$siteId}">
                                                    {$vo}
                                                </option>
                                            </volist>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-md-2 add-space">
                                    <input class="btn btn-primary jsSearchBtn" type="submit" value="搜索">
                                    <input class="btn btn-warning" type="button" onclick="download();" value="导出数据">
                                    <!--<input id="download" class="btn btn-primary jsSearchBtn" type="submit" value="下载">-->
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="clearfix"></div>
                <hr>

                <table class="table table-striped  table-hover" cellspacing="0" width="100%">
                    <thead>
                    <tr>
                        <th>序列</th>
                        <th>账号</th>
                        <th>销售员</th>
                        <th>站点-站点名称</th>
                        <th>FBA总实际库存</th>
                        <th>总待发货数量</th>
                        <th>总已发货数量</th>
                        <th>总FBA待上架库存</th>
                        <th>最近更新日期</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="table_content">
                    <volist name="siteData" id="val" key="num">
                        <tr>
                            <td>{$num}</td>
                            <td>{$val.accountName}</td>
                            <td>{$val.sellerName}</td>
                            <td>{$val.siteName}</td>
                            <td>{$val.localSumQty}</td>
                            <td>{$val.workingSumQty}</td>
                            <td>{$val.shippedSumQty}</td>
                            <td>{$val.receivingSumQty}</td>
                            <td>{$val.calDate}</td>
                            <td><a title="查看该账号数据" href="Api/Amazon/FbaStockBook/account?accountId={$val.accountId}">查看该账号数据</a></td>
                        </tr>
                    </volist>
                    </tbody>
                </table>

                <div class="clearfix clear"></div>
                <div class="row">
                    <div class="col-md-6 pull-left">
                        <label>每页 20 条记录
                            显示 1 到 20 项，共 {$count}项</label>
                    </div>
                    <div class="col-md-6">
                        <div class="page pull-right" style="padding: 0;margin: 0">
                            {$page}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
/**
 * 下载
 */
function download() {
    var accountId = $("input[name='accountId']").val();
    var siteId = $("input[name='siteId']").val();
    var param = 'type=account&accountId=' + accountId + '&siteId=' + siteId;

    window.location.href = '__URL__/download?' + param;
};

</script>




